home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / comm / cnet / INetShell308b.lha / INetShell / Help / ftp < prev    next >
Text File  |  1995-06-27  |  36KB  |  961 lines

  1. f1r1cf      TOPIC:r0  c7FTP
  2. r1cfDESCRIPTION:r0  c7File Transfer Protocol (FTP) menuing system
  3. c2
  4.     THIS IS A LARGE FILE AND IS ADVISED YOU BUFFER THE INFORMATION
  5.  
  6.  The FTP menu system allows you to easily pick sites to FTP to.  The menu
  7. system allows you to move from one directory to another and page from one
  8. to the next.  It even allows you to pick from sites listed in your personal
  9. notebook database file (see document file labeled "NOTE").
  10. c6
  11.  Commands listed on the FTP menu are:
  12.  
  13.   c5#  c1Number of the menu item
  14.         ccThis option allows you to pick from the available listing
  15.         show to you on your screen.  The listing can either be a 
  16.         subdirectory (ie MENU) or a site description.  Entering the
  17.         number of the site list will send you directly to the FTP
  18.         client and attempt a connection to the site.
  19.  
  20.   c5P  c1Move to previous page
  21.         ccThis option only appears if there is a previous page of 
  22.         available to display.
  23.  
  24.   c5N  c1Move to next page
  25.         ccThis option only appears if there is another page ahead of
  26.         the current page on the display.
  27.  
  28.   c5M  c1Call up notebook entries
  29.         ccThis option only appears if there are notebook entries in
  30.         your notebook database file for FTP (See help file on NOTEBOOK).
  31.         Choosing this option (if available) will pull up your entries
  32.         from your FTP database and allow you to choose from the selected
  33.         list.
  34.  
  35.   c5Q  c1Quit and return to INetShell main menu
  36.         ccThis option will return you to the INetShell main menu.
  37.  
  38. c6
  39. NcFTP Client Commands:
  40. c7
  41.  
  42. SYNOPSIS
  43.      ncftp [program options] [[open options] hostname[:pathname]]
  44.  
  45. DESCRIPTION
  46.      NcFTP is a user interface  to  the  Internet  standard  File
  47.      Transfer  Protocol.   This program allows a user to transfer
  48.      files to and from a remote network site,  and  offers  addi-
  49.      tional  features  that  are not found in the standard inter-
  50.      face, ftp.
  51.  
  52. FEATURES
  53.      Program options will be explained later  in  this  document.
  54.      Let's  get  down  to  business and go over the features that
  55.      make this program worthwhile.
  56.  
  57.      Here is the list of section headers;  I  have  my  $MANPAGER
  58.      environment  variable  set  to use ``less -i'' so that I can
  59.      skip to the section I want (otherwise,  /regex  commands  to
  60.      the  pager  won't  match  the section headers because of the
  61.      formatting codes; the ``-i'' can search through the  format-
  62.      ting codes)
  63.  
  64.           Establishing the remote connection
  65.           Format of the RC file
  66.           The Recent-sites file
  67.           Redialing a busy remote site
  68.           Supplying a sitename from your shell's command line
  69.           Using Colon-mode
  70.           Using FTP-cat and FTP-more mode
  71.           Supplying a port number with the open command
  72.           Displaying and changing program variables
  73.           Program variables
  74.           Listing a remote directory
  75.           Viewing a remote directory with your pager
  76.           Redisplaying the last directory listing
  77.           Fetching files from the remote host
  78.           Viewing a remote file with your pager
  79.           Creating a message file on the remote host
  80.           Looking up site names and addresses
  81.           Checking the configuration of the program
  82.           Using the command shell
  83.           Customizing the prompt
  84.           Keeping a log of your file transfers
  85.           Program options
  86.           A sample RC file
  87.  
  88. Establishing the remote connection
  89.      Just opening a connection to  a  remote  server  was  incon-
  90.      venient  enough  in the stock ftp program to justify writing
  91.      this program.  Here at NCEMRSoft, we want to do our business
  92.      as  quickly  and  painlessly  as possible.  We'd rather save
  93.      time and wear and tear on our metacarpals than bother typing
  94.      entire site names, usernames, and email addresses masquerad-
  95.      ing as passwords, and setting binary mode.
  96.  
  97.      We  made  all  connections  anonymous  by  default,  and  we
  98.      automatically  send  our  email  address for the password on
  99.      those connections.  We allowed for site names to be abbrevi-
  100.      ated.
  101.  
  102.      For each commonly accessed site, you can  put  an  entry  in
  103.      your  program  preferences file (let's call it the ``ncftprc
  104.      file'' or ``RC file'' for short).  To open  the  site,  from
  105.      the command shell all you do is type:
  106.  
  107.           open wuarchive.wustl.edu
  108.  
  109.      or
  110.  
  111.           o wuarchive.wustl.edu
  112.  
  113.      As promised, you can abbreviate that further.  Just use  any
  114.      abbreviation that would match only the site you had in mind.
  115.      For the previous example, you could try:
  116.  
  117.           o wuarc
  118.           o wustl
  119.           o stl
  120.           o wu
  121.  
  122.      Any of those abbreviations  would  open  wuarchive.wustl.edu
  123.      anonymously, sending your anon-password (usually set to your
  124.      email address) as the password.  Keep in mind that the  pro-
  125.      gram tries opening the first site that matches the abbrevia-
  126.      tion you supplied.  So:
  127.  
  128.           o w
  129.  
  130.      might match a site named  bowser.nintendo.jp  if  that  site
  131.      appeared before your entry for wuarchive.wustl.edu.
  132.  
  133.      Most of the time we open remote sites anonymously, but there
  134.      are times where you need to specifically open a site with an
  135.      actual username and password.  Let's say  my  partner,  Phil
  136.      Dietz, wants to FTP something out of my account.  Perhaps he
  137.      wants to fetch the latest version  of  the  source  code  to
  138.      NcFTP  so  he  can  optimize  something or add a new feature
  139.      behind my  back.   Since  the  program  opens  remote  sites
  140.      anonymously  by  default  (actually,  you  can  change  this
  141.      behavior; more on that later), he would have  to  specify  a
  142.      flag  to  the  open command so he can supply my username and
  143.      password.  He would try:
  144.  
  145.           o -u sphygmomanometer.unl.edu
  146.  
  147.      or, more likely:
  148.  
  149.           o -u sph
  150.  
  151.      Then the program would prompt him  for  a  username  (login,
  152.      whatever) and a password:
  153.  
  154.           Login Name (pdietz): mgleason
  155.           Password: ********
  156.  
  157.      If he got it right, he could raid my stuff.   If  not,  he'd
  158.      probably  drop  me  an  email  asking me to quit changing my
  159.      password so often.
  160.  
  161.      There are even times where you want to  FTP  from  your  own
  162.      account,  like if you are debugging an FTP client you wrote.
  163.      At this prompt:
  164.  
  165.           Login Name (mgleason):
  166.  
  167.      I could just hit return to tell  the  program  that  I  want
  168.      ``mgleason'' as my username, then I would enter my password.
  169.  
  170. Format of the RC file
  171.      This release of the program is somewhat compatible with  the
  172.      stock _^f_^t_^p program's .netrc file.  However, I can promise you
  173.      that in the near future the program will use a  new  format,
  174.      so don't invest too much time in it.
  175.  
  176.      The  RC  file  can  be  named  ``ncftprc'',  ``netrc'',   or
  177.      ``.ncftprc'',  but  it is usually named ``.netrc'' so it can
  178.      be used with the stock _^f_^t_^p  program.   NcFTP  looks  in  the
  179.      current  working  directory for any of those files, and then
  180.      in your home directory, and after that it gives up (which is
  181.      OK, because RC files aren't mandatory).
  182.  
  183.      The file usually starts with #set and #unset  commands  that
  184.      do  things  to  the  programs variables.  The reason for the
  185.      ``#'' is so the stock ftp program will think they  are  com-
  186.      ments.  You might have this appearing as the first few lines
  187.      in your RC file (I'll explain later):
  188.  
  189.           #set debug 1
  190.           #set pager "less -EMi"
  191.           #unset startup-msg
  192.  
  193.      After those, you put in machine entries  for  each  of  your
  194.      favorite    sites.     Let's    put    in   an   entry   for
  195.      wuarchive.wustl.edu.  First you would put:
  196.  
  197.           machine wuarchive.wustl.edu
  198.  
  199.      Then you could put in your username, password,  and  account
  200.      if you like:
  201.  
  202.           user anonymous
  203.           password -mgleason@cse.unl.edu
  204.           account wuarc.does.not.use.accounts
  205.  
  206.      Following that, you would add the startup macro that is  run
  207.      each  time you connect to wuarchive.  You must start it with
  208.      this line:
  209.  
  210.           macdef init
  211.  
  212.      Then put in the commands you want to do:
  213.  
  214.           cd /graphics/gif
  215.           ls -lt
  216.  
  217.      After that, you end the macro  with  a  blank  line  (impor-
  218.      tant!).  The finished machine entry would look like the fol-
  219.      lowing.  To make the transition to the impending new  format
  220.      less painful, I recommend you adhere to this format:
  221.  
  222.           machine wuarchive.wustl.edu
  223.                 user anonymous
  224.                 password -mgleason@cse.unl.edu
  225.                 account wuarc.does.not.use.accounts
  226.                 macdef init
  227.                       cd /graphics/gif
  228.                       ls -lt
  229.                 (mandatory blank line to end the macro)
  230.  
  231.      Of  course,  if  all  you  want  to  do  is  open  wuarchive
  232.      anonymously,  you  needn't bother with the ``user'', ``pass-
  233.      word'', and ``account'' lines.  You may want to put them  in
  234.      if  you  plan  on  using the stock ftp program, though.  Try
  235.      something like this:
  236.  
  237.           machine wuarchive.wustl.edu
  238.                 macdef init
  239.                       cd /graphics/gif
  240.                       ls -lt
  241.                 (mandatory blank line to end the macro)
  242.  
  243.      You can tell the program to not run the startup macro if you
  244.      supply -i to the open command.
  245.  
  246.      Really, you should only bother adding entries for sites that
  247.      you  want  to  run startup macros upon connection.  The next
  248.      section explains why.
  249.  
  250. The Recent-sites file
  251.      Each time you open a site, the program saves the name of the
  252.      site  and the last directory you were in to the recent-sites
  253.      file which is named .ncrecent and placed in your home direc-
  254.      tory.   The  program  saves  a predetermined number of these
  255.      sites in the file, and when it reaches the  limit,  it  dis-
  256.      cards the oldest entry so it can add a new one.
  257.  
  258.      You can just go ahead and use the name of the site you  want
  259.      with  the  open command if you know it is in the recent-file
  260.      (and you can abbreviate the name, just like those in the  RC
  261.      file).  But if you cannot remember what the name of the site
  262.      you want, all you do is run the open command  with  no  site
  263.      parameter:
  264.  
  265.           open
  266.  
  267.      This will pop up a list of the sites in the recent-file, and
  268.      sites  in  your  RC file.  At the open prompt, just type the
  269.      name (or an abbreviation of that name) or the number preced-
  270.      ing the site name to open that site.  After opening the site
  271.      you wanted, the program sets the remote working directory to
  272.      the same one you left in the last time you called.
  273.  
  274.      If you don't like the idea of having the  sites  you  called
  275.      stored on disk, you can turn this feature off using an unset
  276.      command, explained later.
  277.  
  278. Redialing a busy remote site
  279.      Some remote sites limit the number of leeches, er, anonymous
  280.      connections  at  a  time to reduce the load on the host com-
  281.      puter.  You can use the open  command's  redial  feature  to
  282.      keep  attempting connections until you get on, although that
  283.      is not a very polite thing to do.  The simplest  way  to  do
  284.      this would be to just supply the -r option:
  285.  
  286.           open -r wuarc
  287.  
  288.      There are also options you can use to tweak redial.  The  -d
  289.      flag  sets  the  delay between dials, and the -g flag sets a
  290.      limit on how many dials should be attempting  before  giving
  291.      up.   If you don't supply -g the program will dial a day and
  292.      forever (which my Number Theory professor, Dr. Mientka, says
  293.      is longer than forever and a day) until it connects success-
  294.      fully, or until you get sick of waiting and hit  the  inter-
  295.      rupt key (usually ^C).
  296.  
  297.  
  298.      This example dials wuarchive every ten  minutes,  giving  up
  299.      after twenty attempts.  Note that the redial delay is speci-
  300.      fied in seconds:
  301.  
  302.           open -r -d 600 -g 20 wuarc
  303.  
  304.      Please be considerate when you use redialing, so  you  won't
  305.      tax  the  network.  Site administrators can and do get angry
  306.      when they get flooded with connections.
  307.  
  308. Supplying a sitename from your shell's command line
  309.      When you run the program:
  310.  
  311.           ncftp
  312.  
  313.      by itself does nothing and waits for you to type commands to
  314.      the  program's  own shell.  Just like the stock ftp program,
  315.      you can supply a site name on the command line:
  316.  
  317.           ncftp wuarchive.wustl.edu
  318.  
  319.      You can also use abbreviations as usual:
  320.  
  321.           ncftp wuarc
  322.  
  323.      This is equivalent to running the program, then  issuing  an
  324.      open command to open wuarchive.
  325.  
  326. Using Colon-mode
  327.      The open command is not a one-trick pony.  Another option is
  328.      what  I  call colon-mode.  This feature is used (most of the
  329.      time) from your shell's command line.
  330.  
  331.      In ancient times, way back during the Disco era,  you  could
  332.      use a program called tftp to fetch a file using the Internet
  333.      standard Trivial File Transfer Protocol. You could use  that
  334.      program to do something like this from within its shell:
  335.  
  336.           get wuarchive.wustl.edu:/graphics/gif/README
  337.  
  338.      and that would call wuarchive and fetch the README file.
  339.  
  340.      You can use this program to do  the  same  thing  from  your
  341.      shell's command line:
  342.  
  343.           csh> ncftp wuarchive.wustl.edu:/graphics/gif/README
  344.           csh> head README
  345.  
  346.      This tells your shell, in this case the ``c-shell''  to  run
  347.      NcFTP,     which     would     open     wuarchive,     fetch
  348.      /graphics/gif/README and write  the  file  ./README  in  the
  349.      current  working directory, and then exits.  This is nice if
  350.      you don't want to browse around the  remote  site,  and  you
  351.      know  exactly want you want.  It would also come in handy in
  352.      shell scripts, where you don't want  to  enter  the  command
  353.      shell, and might not want the program to spew output.
  354.  
  355.      You can use colon-mode to set the  starting  remote  working
  356.      directory also:
  357.  
  358.           csh> ncftp wuarchive.wustl.edu:/graphics/gif
  359.  
  360.      This would run the program, open wuarchive, and  cd  to  the
  361.      gif  directory,  then run the program's command shell so you
  362.      can browse.
  363.  
  364.      Colon-mode is also available from within the program's  com-
  365.      mand shell.  At a prompt you can do stuff like this:
  366.  
  367.           ncftp> open wuarchive.wustl.edu:/graphics/gif/README
  368.           ncftp> o wuarc:/graphics/gif
  369.  
  370. Using FTP-cat and FTP-more mode
  371.      There are times where you might  not  want  the  program  to
  372.      write a colon-mode file in the current working directory, or
  373.      perhaps you want to pipe the output of a  remote  file  into
  374.      something  else.  Colon-mode has options to do this.  It was
  375.      inspired by the guy who wrote the ftpcat perl  script.   The
  376.      -c  option tells the program to write on the standard output
  377.      stream.  The -m option pipes the file into your pager  (like
  378.      more)  Of  course  this  won't  work  if  the thing you give
  379.      colon-mode is a directory!  This example just dumps a remote
  380.      file to stdout:
  381.  
  382.           csh> ncftp -c wuarc:/graphics/gif/README
  383.           ...
  384.           csh>
  385.  
  386.      This example redirects a remote file into a different  loca-
  387.      tion:
  388.  
  389.           csh> ncftp -c wu:/README > ~pdietz/thesis.tex
  390.  
  391.      This one shows how to use a pipeline:
  392.  
  393.           csh> ncftp -c wuarc:/README | tail | wc -l
  394.           10
  395.           csh>
  396.  
  397.      This shows how to page a remote file:
  398.  
  399.           csh> ncftp -m wuarc:/graphics/gif/README
  400.           ...
  401.           csh>
  402.  
  403.  
  404. Supplying a port number with the open command
  405.      This option just didn't fit anywhere else, so to finish  out
  406.      the  open  command,  -p lets you supply a port number if you
  407.      have to ftp to a site  using  an  nonstandard  port  number.
  408.      Personally,  I  have  yet  to use feature, but its there for
  409.      compatibility with the stock ftp program.
  410.  
  411. Displaying and changing program variables
  412.      Now I'll explain the commands unique to NcFTP.   The  others
  413.      should  perform the same as they would in the stock ftp pro-
  414.      gram; consult  the  man  page  for  it  if  you  want  those
  415.      explained, or use the help command for a brief blurb.
  416.  
  417.      The show command is used to display  program  variables  and
  418.      their values.
  419.  
  420.           show all
  421.  
  422.      or
  423.  
  424.           show
  425.  
  426.      would display all the variables with their values.
  427.  
  428.           show var1 var2 ... varN
  429.  
  430.      would display each specified variable and its value.
  431.  
  432.      The set command changes the value  of  a  program  variable.
  433.      Its syntax is:
  434.  
  435.           set varname value
  436.  
  437.      For Boolean or Integer variables,
  438.  
  439.           set varname
  440.  
  441.      would set the value of the variable varname to 1 (true).
  442.  
  443.      The unset command can be used to set  the  variable  to  its
  444.      default value, or for Boolean and Integer variables, set the
  445.      value of the variable to 0 (false).  For  String  variables,
  446.      you can use this to set the value to an empty string.
  447.  
  448.      You can use any of those three commands in both the  command
  449.      shell, or in the RC file with a ``#'' prepended.
  450.  
  451. Program variables
  452.      Each variable can be one of the following types:
  453.  
  454.      Boolean:
  455.           Can be ``on'' or ``off'' (you can  also  use  ``1''  or
  456.           ''0''.
  457.  
  458.      Integer:
  459.           Can be any positive or negative number, or 0.
  460.  
  461.      String:
  462.           Is a string of characters.  If the string needs to have
  463.           a  space in it, make sure you surround the whole string
  464.           with double quotes in a set command.
  465.  
  466.      Variables follow.  Some variables are explained later in the
  467.      relevant sections.
  468.  
  469.      anon-open (Boolean)
  470.           Tells whether the default login mode  is  anonymous  if
  471.           on,  or  if  off,  will prompt for a username/password.
  472.           You can always override this by using either -a  or  -u
  473.           with the open command.
  474.  
  475.      anon-password (String)
  476.           Sends this as the password when you login  anonymously.
  477.           By default this is your email address.
  478.  
  479.      ansi-escapes (Boolean)
  480.           If on, the program can  use  boldface,  underline,  and
  481.           inverse text.
  482.  
  483.      auto-binary (Boolean)
  484.           If on, sets the transfer type to  binary  mode  immedi-
  485.           ately after connection.
  486.  
  487.      debug (Integer)
  488.           Sets the debugging level.
  489.  
  490.      gateway-login (String)
  491.           Tells which username to use when  logging  in  to  your
  492.           firewall gateway host.
  493.  
  494.      gateway-host (String)
  495.           The site which is acting as your firewall  gateway,  or
  496.           empty if you aren't using one.
  497.  
  498.      local-dir (String)
  499.           The current local working directory.   I  like  to  set
  500.           this  from my RC file, so all my files go into my down-
  501.           load directory.
  502.  
  503.      logfile (String)
  504.           The name of your personal transfer log, or empty if you
  505.           aren't using a transfer log.
  506.  
  507.      logsize (Integer)
  508.           The maximum ceiling of your log file, before  the  pro-
  509.           gram removes old entries.
  510.  
  511.      mprompt (Boolean)
  512.           If on, prompts for each remote  file  expanded  from  a
  513.           wildcard globbing expression.
  514.  
  515.      netrc (String, Read-only)
  516.           Tells you the name of the RC file in use.
  517.  
  518.      pager (String)
  519.           The pathname and flags of the program used  to  display
  520.           output  one  screenful  at  a time.  The default is the
  521.           value of your $PAGER environment variable.
  522.  
  523.      prompt (String)
  524.           The prompt specification that expands into the prompt.
  525.  
  526.      progress-reports (Integer)
  527.           Which progress meter to use, or 0  if  you  don't  want
  528.           progress reports during file transfers.
  529.  
  530.      recent-list (Boolean)
  531.           If on, uses and updates the recent-file.
  532.  
  533.      remote-is-unix (Boolean)
  534.           Set automatically by the program upon  connection,  you
  535.           may  need to use this in a startup macro if the program
  536.           guessed that a remote site was UNIX when it  really  is
  537.           not.
  538.  
  539.      startup-msg (Boolean)
  540.           If on, prints the opening message and tip.
  541.  
  542.      tips (Boolean)
  543.           If on, prints a tip on how to use  the  program  better
  544.           each time you run the program.
  545.  
  546.      type (String)
  547.           The name of the file transfer  mode  in  use,  such  as
  548.           ``binary'' or ``ascii''.
  549.  
  550.      verbose (String/Integer)
  551.           Controls the amount of output spewed  by  the  program.
  552.           You  can  supply either the first character of the name
  553.           of the verbosity level, or its number:
  554.  
  555.           Quiet (-1)
  556.                Won't print any output at all, even  if  an  error
  557.                occurs.
  558.  
  559.           Errors Only (0)
  560.                No output, except when errors occur.
  561.  
  562.           Terse (1)
  563.                Prints errors, and useful output from  the  remote
  564.                host.
  565.  
  566.           Verbose (2)
  567.                Prints  everything,  even  junk  output  from  the
  568.                remote end.
  569.  
  570. Listing a remote directory
  571.      The ls and dir commands perform in a similar manner to those
  572.      of the stock ftp program.
  573.  
  574.      The ls command sends the FTP command ``NLST'' for you.  This
  575.      command  has  been set so that it defaults to always listing
  576.      files in columns (this is the -C option given to the UNIX ls
  577.      command)  and  appending  metacharacters  to  each item name
  578.      (this is the -F option), so you  can  see  which  items  are
  579.      directories, files, links, etcetera.  If you don't want your
  580.      items columnized, you can try using the -1 option with ls to
  581.      print one item per line.
  582.  
  583.      The dir command sends the  FTP  command  ``LIST''  for  you,
  584.      which  instead  of  printing just item names, it prints item
  585.      sizes, owners, dates, and permissions as well.  This command
  586.      is equivalent to ``ls -l'' on most remote systems.
  587.  
  588.      The usage for both commands is the same.  Here  is  the  one
  589.      for ls:
  590.  
  591.           ls [-flags] [directory and file names] [redirection]
  592.  
  593.      Note that in this program, you can  supply  both  flags  and
  594.      items to list in the same command.  The stock version of ftp
  595.      doesn't let you do this:
  596.  
  597.           ls -lrt /info-mac/help
  598.  
  599.      Another thing that the program does which the others  should
  600.      have done is let you supply more than one item:
  601.  
  602.           ls -lrt /info-mac/help /pub /info-mac/README
  603.  
  604.      You can also redirect the output into a  file,  or  pipe  it
  605.      into something.  This example shows how to list the contents
  606.      of the current remote directory, and save the output into  a
  607.      file in the current local directory:
  608.  
  609.           ls -t >ls.out
  610.  
  611.      Note that for this to work,  there  must  be  no  whitespace
  612.      between  the  ``>'' and the filename, unlike your shell com-
  613.      mand line which allows for extra whitespace.  This  will  be
  614.      (actually, is) fixed in a future version of the program.
  615.  
  616.      These examples show how to use a pipe:
  617.  
  618.           ls -t |tail
  619.           dir -t "|less -CM"
  620.           ls -t "|tail | wc"
  621.  
  622.      Like the redirection example, there must  be  no  whitespace
  623.      between  the first pipe character and the rest of the stuff.
  624.      The trick is that it has to appear as one  argument  to  the
  625.      commands.   The second and third examples illustrate the use
  626.      of double quotes to squeeze extra parameters in.  The second
  627.      example  can  be  done  without  all  that  typing.  See the
  628.      descriptions of the pdir and pls commands below.
  629.  
  630. Viewing a remote directory with your pager
  631.      Didn't you hate it when you listed a remote directory,  only
  632.      to  have most of the stuff scrolled off your terminal before
  633.      you could read it?  The pls and pdir commands take  care  of
  634.      this  for  you.   As  you  might  have guessed, they perform
  635.      exactly like their regular counterparts, only you view  them
  636.      with  your  pager.   The  pager  to use is controlled by the
  637.      pager program variable.
  638.  
  639. Redisplaying the last directory listing
  640.      The program saves the listing into a local buffer, so if you
  641.      need  to  see  it again (probably forgot about pdir) you can
  642.      use the redir and predir commands for this.
  643.  
  644. Fetching files from the remote host
  645.      The get and mget retrieve remote files for you.   The  usage
  646.      for get is:
  647.  
  648.           get remote-file [local-file or redirection]
  649.  
  650.      To  fetch  /pub/README  and  write  it  as  a   file   named
  651.      ./junk/readme, try:
  652.  
  653.           get /pub/README ./junk/readme
  654.  
  655.      To fetch /pub/README and write it as ./README, just do:
  656.  
  657.           get /pub/README
  658.  
  659.      This lets you fetch a file using  its  whole  pathname,  and
  660.      write  a copy of it in the current directory, without having
  661.      to bother with typing a local  filename.   In  the  unlikely
  662.      event  that  you have write permission to a directory called
  663.      /pub on your local machine, it  would  write  ``README''  in
  664.      that directory.
  665.  
  666.      Most of the time the file you want will be  in  the  current
  667.      remote directory, so you can just do these:
  668.  
  669.           get README
  670.           get README ./junk/readme
  671.  
  672.      You can also use a redirection for get, just  like  you  can
  673.      with the ls, dir, and redir commands.  As described earlier,
  674.      you have to conform to the format below for this release  of
  675.      the program:
  676.  
  677.           get README >/dev/null
  678.           get README |head
  679.           get README "|head -8"
  680.           get README "|less -EMi"
  681.  
  682.      The  last  example  is  facilitated  by  the  page   command
  683.      described later.
  684.  
  685.      The get command can also use a  wildcard  expression  in  an
  686.      attempt  to match exactly one remote file.  I call it ``Poor
  687.      Man's File Completion.'' If you've done  a  remote  listing,
  688.      and  you  decide  you want to download a file by the name of
  689.      ``obnoxiouslylongpackagename.tar.Z'', you can  use  ``PMFC''
  690.      to  save  some  keystrokes.   Choose an expression that will
  691.      only match that one file, then use it with get:
  692.  
  693.           get obn*.Z a.tar.Z
  694.  
  695.      If your pattern was unique, get will fetch that  file  only.
  696.      If  the pattern matched more than one file, the program will
  697.      bitch and moan.
  698.  
  699.      The mget command is used to fetch many files at a time.  The
  700.      difference  between  get and mget is that get lets you write
  701.      only one file, but you can put it in a different  directory,
  702.      while  mget  fetches  many files, always writing them in the
  703.      current  local  directory.   This  example  fetches  several
  704.      remote files at once:
  705.  
  706.           mget a.file.Z b.file.Z c.tar d.tar.Z
  707.  
  708.      The mget command, and its ugly sisters, mput and mdelete let
  709.      you  use wildcard expressions.  I could have done the previ-
  710.      ous example as:
  711.  
  712.           mget *.Z c.tar
  713.  
  714.      instead.  The ``m'' commands will verify each file,  if  you
  715.      have the program variable mprompt set.
  716.  
  717. Viewing a remote file with your pager
  718.      If you would like to read a file on the remote host  without
  719.      saving  a  copy  of it on your machine, you can use the page
  720.      (or more if you wish) command:
  721.  
  722.           page README
  723.           page obn*README
  724.           page README.Z
  725.  
  726.      The second example show that you can use ``PMFC''  like  you
  727.      can  for  get.  The third example will work also, because if
  728.      the program knows how to decompress the file, it will do  so
  729.      before feeding it to your pager.  As stated earlier, you can
  730.      change the program to use to page  by  setting  the  program
  731.      variable pager.
  732.  
  733. Creating a message file on the remote host
  734.      Use the create an empty file on the remote site.   Sometimes
  735.      it  is  necessary  to leave a note if you can't get in touch
  736.      with the remote site's administrator.  For example if a file
  737.      is corrupted, you could try:
  738.  
  739.           create Foo.tar_is_corrupt
  740.  
  741.      in hopes that the original uploader will replace it.
  742.  
  743. Looking up site names and addresses
  744.      You can use the program's  builtin  mini-nslookup  facility.
  745.      If  you  wanted  to know the site's IP number, but only knew
  746.      the name you could do:
  747.  
  748.           lookup cse.unl.edu
  749.  
  750.      This would spit out IP number for that site,  in  this  case
  751.      ``129.93.1.12''.   If  you needed to know what a site's name
  752.      was, but only knew the IP number, try:
  753.  
  754.           lookup 129.93.1.12
  755.  
  756.      This would spit out the name for that  site,  in  this  case
  757.      ``cse.unl.edu''.
  758.  
  759. Checking the configuration of the program
  760.      Use the version command to  print  version  and  compilation
  761.      information  about  the  program.   This  will also tell you
  762.      which optional features are compiled into the program,  such
  763.      as  logging  to the system log and which command line editor
  764.      (if any) has been installed.
  765.  
  766.      The author's email address is listed, and  if  you  need  to
  767.      report something, send the output of this command along with
  768.      your message.
  769.  
  770. Using the command shell
  771.      Just like the stock ftp program, you  type  commands  to  it
  772.      until  you get bored and hit either ^D or type the quit com-
  773.      mand.
  774.  
  775.      The program supports links to popular command  line  editing
  776.      libraries.   If  the  person  who  compiled  it  went to the
  777.      effort, you will be able to edit the command line with arrow
  778.      keys and other editing commands, and also scroll up and down
  779.      in the command line history, usually with the  up  and  down
  780.      arrows.   You can check the version command to see if either
  781.      ``GETLINE'' or ``READLINE'' are installed.
  782.  
  783. Customizing the prompt
  784.      You can set the shell's prompt string to whatever you  like.
  785.      You  can  use  several metacharacters that expand into some-
  786.      thing  each  prompt.   The  ``%''  flags   are   passed   to
  787.      strftime(3),  so  you can put the date or time in the prompt
  788.      formatted as you like it:
  789.  
  790.           set prompt "%I:%M ncftp>"
  791.  
  792.      That would the current time in the prompt.
  793.  
  794.      The ``@'' flags are expanded by the program itself.   Here's
  795.      the list of them.
  796.  
  797.      If you have an ANSI-compatible terminal,  or  you  have  the
  798.      program  variable  ansi-escapes set, you can use @B, @I, and
  799.      @U to turn on boldface, inverse, and underline text  respec-
  800.      tively (otherwise they won't insert anything).  You can also
  801.      use @R to turn on inverse (reverse) text.  @P sets the  text
  802.      back to plain text.
  803.  
  804.      @D Inserts the full path of the  current  remote  directory.
  805.      The  @J flag is similar except it inserts only the directory
  806.      name.
  807.  
  808.      @H Inserts the name of the remote host.  @C inserts the host
  809.      and  current  directory  path  in colon-mode format, such as
  810.      ``cse.unl.edu:/pub/mgleason'', or ``(not connected)''.   The
  811.      @c    flag    is    similar,    only    it    will    insert
  812.      ``cse.unl.edu:/pub/mgleason'' and a  newline  if  connected,
  813.      otherwise  it  prints nothing.  The default prompt uses this
  814.      flag to print a two line prompt when  connected  and  a  one
  815.      line prompt when not connected.
  816.  
  817.      @E or @!  inserts the event number (how many commands you've
  818.      typed).
  819.  
  820.      @M inserts ``(Mail) '' if mail has arrived since running the
  821.      program.
  822.  
  823.      @N inserts a newline character.
  824.  
  825. Keeping a log of your file transfers
  826.      You can have the program keep a personal log file.   I  find
  827.      it  is  useful  so  I can see where I got a certain file, or
  828.      what the name of that site was I called two weeks ago.
  829.  
  830.      To use a log, add:
  831.  
  832.           #set logfile ~/.ftplog
  833.  
  834.      (or whatever you want to name the log) to your RC  file.   I
  835.      don't want my log growing too large and using up all my disk
  836.      space, so I also have:
  837.  
  838.           #set logsize 10240
  839.  
  840.      in my RC file.  If you set the  limit  on  the  maximum  log
  841.      size,  the  program  will keep the log file at or below that
  842.      size, discarding old entries.
  843.  
  844.      Note that this is different from having SYSLOG appear in the
  845.      version command's output.  When this is on, your actions are
  846.      recorded to the system log, so your system administrator can
  847.      make sure you aren't doing anything ``bad.''
  848.  
  849. Program options
  850.      Remember that you can treat the command line  like  an  open
  851.      command,  so  all  lowercase  options are passed to the open
  852.      command, and the uppercase options are handled by  the  main
  853.      program.   The  uppercase options are described below; refer
  854.      to the open command for descriptions of its options.
  855.  
  856.      -D x sets the debugging level to x.
  857.  
  858.      -H   runs the version command and exits, so you can save the
  859.           output of it to use when you need to mail me something.
  860.  
  861.      -I   toggles the mprompt variable; this is provided for com-
  862.           patibility with ``ftp -i''.
  863.  
  864.      -N   disables reading of the RC file; this is  provided  for
  865.           compatibility with ``ftp -n''.
  866.  
  867.      -V x sets verbosity to level x (-1,  0,  1,  2)  or  (quiet,
  868.           errs,  terse,  verbose).   See  the  description of the
  869.           verbose program variable for more information.
  870.      
  871.      Here  are  some  example  command  lines.   Again,  see  the
  872.      description  of  the open command (especially colon-mode and
  873.      FTP-cat mode) and all its functions for more information.
  874.  
  875.      This just enters the NcFTP command shell:
  876.  
  877.           csh> ncftp
  878.  
  879.      This fetches CONTENTS and then quits:
  880.  
  881.           csh> ncftp cse.unl.edu:/pub/mgleason/CONTENTS
  882.  
  883.      Some others examples, with open  options  and  main  program
  884.      options mixed in:
  885.  
  886.           csh> ncftp -V quiet -u ftp.unl.edu
  887.           csh> ncftp -c cse.unl.edu:/pub/mgleason/CONTENTS
  888.           csh> ncftp -D 2 -r -d 120 -g 10 -N ftp.unl.edu
  889.  
  890. A sample RC file
  891.      Here is a sample RC file:
  892.  
  893.           #set logfile ~/.ftplog
  894.           #set progress-reports 2
  895.           #set local-dir /usr/tmp/zz
  896.           #set prompt "@B@E @UNcFTP@P @B@M@D@P ->"
  897.  
  898.           machine sumex-aim.stanford.edu
  899.                 macdef init
  900.                       cd /info-mac
  901.                       get ./help/recent-files.txt "|grep -v '.abs' > sumex
  902.                       !less sumex
  903.                       pwd
  904.  
  905.           # This site is in here just so I can use ``apple''
  906.           # as an abbreviation.
  907.           machine ftp.apple.com
  908.  
  909.           # NcFTP will only ask for your password:
  910.           machine cse.unl.edu
  911.                 login mgleason
  912.  
  913.           # You can supply a login and a password:
  914.           machine fake.machine.unl.edu
  915.                 login mgleason
  916.                 password mypass
  917.                 macdef init
  918.                 cd ./foo/bar
  919.  
  920.           # If an antiquated non-UNIX machine doesn't use
  921.           # the "SYST" command, you may need to unset
  922.           # remote-is-unix, if the remote host complains
  923.           # about ``ls -CF''.
  924.           machine some.vms.unl.edu
  925.                 macdef init
  926.                 unset remote-is-unix
  927.  
  928.  
  929. AUTHORS
  930.      NcFTP   was   written    by    Mike    Gleason,    NCEMRSoft
  931.      (mgleason@cse.unl.edu),  and based on code by the authors of
  932.      the ftp from the BSD 4.3 distribution.  NcFTP is copyrighted
  933.      1992,  1993  by  NCEMRSoft  and 1985, 1989 by the Regents of
  934.      California.
  935.  
  936.      Ideas and some code contributed  by  Phil  Dietz,  NCEMRSoft
  937.      (pdietz@cse.unl.edu).   Testing  and  debugging done by Phil
  938.      and Kok Hon Yin (hkok@cse.unl.edu).
  939.  
  940.      Extensive man page formatting work  by  DaviD  W.  Sanderson
  941.      (dws@ssec.wisc.edu).
  942.  
  943. BUGS
  944.      Correct execution  of  many  commands  depends  upon  proper
  945.      behavior by the remote server.
  946.  
  947.      The remote server may drop the connection if you take a long
  948.      time to page remote files.
  949.  
  950.      Termcap padding is not correctly displayed.
  951.  
  952.      There  are  no  such  sites  named   bowser.nintendo.jp   or
  953.      sphygmomanometer.unl.edu.
  954.  
  955.  
  956.  
  957. u1cfOTHER COMMANDS AVAILABLE AT THIS PROMPTu0:c7
  958.  
  959. ARCHIE  CONFIG  DIR     HELP    IRC     MAIN
  960. NOTE    QUIT    REDRAW  TALK    TELNET  PING  VIEW 
  961.